#include <iostream>
#include<cstring>
using namespace std;
void rexerse(int* a, int left, int right)
{
    while (left < right)
    {
        int tmp = a[left];
        a[left] = a[right];
        a[right] = tmp;
        --right;
        ++left;
    }



}
void rotate(int* nums, int numsSize, int k)
{
    if (k > numsSize)
        k %= numsSize;
    rexerse(nums, 0, numsSize - k - 1);
    rexerse(nums, numsSize - k, numsSize - 1);
    rexerse(nums, 0, numsSize - 1);

}